class SourceLine(object):
    
    def __init__(self):
        self.__parts = []
        
    def add_text(self, text):
        self.__parts.append(('TXT', text))
        return self
        
    def add_inline_expr(self, expr):
        self.__parts.append(('IE', expr))
        return self
    
    def render(self, scope):
        line = ''
        for catg, content in self.__parts:
            if catg == 'TXT':
                line += content
            else: # inline expression
                line += str(content.eval(scope))
        return [line]
        
        